package labox.innovation.gameserver.model.actor.instance;

import labox.innovation.config.Config;
import labox.innovation.gameserver.cache.HtmCache;
import labox.innovation.gameserver.model.actor.L2Npc;
//import labox.innovation.gameserver.network.serverpackets.ExShowDominionRegistry;
import labox.innovation.gameserver.templates.chars.NpcTemplate;

/**
 * NPC that gives information about territory wars
 * @author  GodKratos
 */
public class L2MercenaryManagerInstance extends L2Npc {
	/**
	 * @param objectId
	 * @param template
	 */
	public L2MercenaryManagerInstance(int objectId, NpcTemplate template) {
		super(objectId, template);
	}

	@Override
	public void onBypassFeedback(FuzePcInstance player, String command) {
		if (command.equalsIgnoreCase("Territory")) {
			int terrId = getNpcId() - 36400;
//			player.sendPacket(new ExShowDominionRegistry(terrId));
		} else
			super.onBypassFeedback(player, command);
	}

	@Override
	public String getHtmlPath(int npcId, int val) {
		String temp = "";
		if (val == 0)
			temp = "data/html/mercmanager/MercenaryManager.htm";
		else
			temp = "data/html/mercmanager/MercenaryManager-" + val + ".htm";

		if (!Config.LAZY_CACHE) {
			// If not running lazy cache the file must be in the cache or it doesnt exist
			if (HtmCache.getInstance().contains(temp))
				return temp;
		} else {
			if (HtmCache.getInstance().isLoadable(temp))
				return temp;
		}

		// If the file is not found, the standard message "I have nothing to say to you" is returned
		return "data/html/npcdefault.htm";
	}
}
